libxc: fix out of range shift in populate_acpi_pages
authorWei Liu <wei.liu2@citrix.com>
Wed, 28 Sep 2016 15:38:19 +0000 (16:38 +0100)
committerWei Liu <wei.liu2@citrix.com>
Wed, 28 Sep 2016 15:51:50 +0000 (16:51 +0100)
commitd7c34a18a9fd6c6dccf99eeeeaf14ff352bc4c0d
treed1275824b0e289106e309d6a387d7f4867111877
parent9ef164f8b9e5db09efee6b93e71c842585bd4c0a
libxc: fix out of range shift in populate_acpi_pages

unsigned int is only 4-byte long and "4" is treated as int. The shift
would overflow.

Use unsigned long type, calculate the bits to shift before shifting
instead of shifting twice.

Caught by clang compilation test.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxc/xc_dom_core.c